package com.cqjtu.graduation.controller;

import com.cqjtu.graduation.entity.NoticeDO;
import com.cqjtu.graduation.service.NoticeDOServer;
import com.mysql.cj.protocol.x.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 对通知进行操作的controller
 */
@RequestMapping("/notice")
public class NoticeController {

    @Autowired
    NoticeDOServer noticeDOServer;

    @RequestMapping("/latestnotice")
    public @ResponseBody
    NoticeDO latestNotice(){
        return noticeDOServer.latestNotice();
    }

    @RequestMapping("/save")
    public String saveNotice(String noticecontent){
        noticeDOServer.saveNotice(noticecontent);
        return "";
    }
}
